package com.demo.io.bytestream;

import org.junit.jupiter.api.Test;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * @author wangning
 * @date 2023/12/22 15:50
 * @description
 */
public class OutputStreamTest {
    @Test
    public void test01() {
        try(FileOutputStream fos = new FileOutputStream("src/main/resources/file/output_stream_test.txt");) {
            fos.write(50);
            fos.write('a');
            fos.write("\r".getBytes(StandardCharsets.UTF_8));
            fos.write("你好".getBytes(StandardCharsets.UTF_8));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
